package com.mm.cloud.common.core.util;

import lombok.Getter;
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.stereotype.Component;

/**
 * Spring操作容器工具
 *
 * @author mr
 * @since 2021-09-15
 */
@Component
public class SpringUtils implements ApplicationContextAware {

    /**
     *  获取applicationContext对象
     */
    @Getter
    public static ApplicationContext applicationContext;

    @Override
    public void setApplicationContext(ApplicationContext context) throws BeansException {
        applicationContext = context;
    }

}
